export function handleShortcuts(_time,_arr=[]) {
    let shortcuts = []
    _arr.map(item=>{
        shortcuts.push({
            text: item.title,
            onClick(picker) {
            const date = _time?new Date(_time) : new Date()
            // 月份不能直接加，需要折算成年份
            let _year = item.year||0
            let year = date.getFullYear()+_year
            let month = (date.getMonth()+1)>=10?date.getMonth()+1:'0'+(date.getMonth()+1)
            let curdate = date.getDate()
            const time = _year?new Date(year + '-' + month + '-' + curdate):new Date()
            picker.$emit('pick', time);
            }
        })
    })
    return shortcuts
}